$(document).ready(function(){
	//LOGIN
	$("#btn-login").click(function(){
		$.get('./includes/login.php',{user: $("#user-login").val(), pass: $("#pass-login").val()}).done(function(data){
			if(data=="ok"){
				location.reload();
			}else{
				alert(data);
				location.reload();
			}
		});
	});
	
	//LOGOUT
	$(".btn-logout").click(function(){
		$.get('./includes/logout.php').done(function(data){
			if(data=="ok"){
				alert("Se ha borrado la sesión");
				location.reload();
			}else{
				alert("Hubo un problema, vuélvelo a intentar.");
				location.reload();
			}
		});
	});
});
